package dao.impl;

import dao.AdminDao;
import model.Admin;
import utils.DbUtil;

import java.util.ArrayList;
import java.util.List;

public class AdminDaoImpl implements AdminDao {
    @Override
    public Admin getAdminByNameByPass(String adminName, String password) {

        List<Admin> list = DbUtil.select(Admin.class, "admin_name=? and password=?", adminName, password);
        if(list!=null&&list.size()>0){
            //查到了数据
            return list.get(0);
        }else{
            //没查到数据
            return null;
        }
    }
}
